package com.lsc.admin.demo.bean;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * c策略+工厂，根据需求适配
 * c适用：根据不同需求执行不同实现
 * @author ln
 * 
 */
@Service
public class FactoryForFITestBean {

    @Autowired
    Map<String, FITestBean> FITestBeans = new ConcurrentHashMap<>(3);

    public FITestBean getFITestBean(String component){
        FITestBean FITestBean = FITestBeans.get(component);
        if(FITestBean == null) {
            throw new RuntimeException("no FITestBean defined");
        }
        return FITestBean;
    }

}